import React, { Component } from 'react';
import { Card, Tabs } from 'antd';
import EvaluateSecondNav from '@/components/EvaluateSecondNav/EvaluateSecondNav';
import Comprehensive from './Comprehensive';
import SimilarCompany from './SimilarCompany';
import Comparison from './Comparison';
import DrawPage from './DrawPage';
import limitKeys from '@/utils/limitKeys';
import style from './BusinessPerformance.less';

const { TabPane } = Tabs;
/**
 *  经营绩效
 */
export default class BusinessPerformance extends Component {
  static displayName = 'BusinessPerformance';

  constructor(props) {
    super(props);
    this.state = {
      activeKey: localStorage.getItem('sid') ? localStorage.getItem('sid') : '0',
    };
  }

  componentDidMount() {
    limitKeys();
    // if(GetUrlParam("sid")){
    //   this.setState({
    //     activeKey:GetUrlParam("sid")
    //   })
    // }
  }

  stabChange = key => {
    localStorage.setItem('sid', key);
  };

  render() {
    return (
      <div className="evaluate-wrapper">
        <EvaluateSecondNav />
        <div className={style.BusinessPerformance}>
          <Tabs
            prefix="pre-"
            onChange={this.stabChange.bind(this)}
            defaultActiveKey={this.state.activeKey}
          >
            <TabPane tab="综合评价" key={0}>
              <Comprehensive />
            </TabPane>

            <TabPane tab="相似聚类" key={1}>
              <SimilarCompany />
            </TabPane>

            <TabPane tab="竞品对比" key={2}>
              <Comparison />
            </TabPane>
            <TabPane tab="作图工具" key={3}>
              <DrawPage />
            </TabPane>
          </Tabs>
        </div>
      </div>
    );
  }
}
